import bb.cascades 1.0

Page {
    id: chartdetail
    actions: [
        // define the actions for first tab here
        ActionItem {
            title: qsTr("Rotate")
            onTriggered: {
                //                imgTab1.rotationZ = imgTab1.rotationZ + 90;
            }
        },
        ActionItem {
            title: qsTr("Break")
            onTriggered: {
                //                imgTab1.imageSource = "asset:///images/picture1br.png";
            }
        }
    ]
    
    Container {
        Container {
            Label {
                text: "aaaaaaaaaaaaaaaaaaaaaaa"
            }
        }
        
        Divider {
        }
        
        Container {
            ImageView {
                imageSource: "asset:///images/picture1.png"
            }
        }
        Button {
            text: "next"
            
            onClicked: {
                // show detail page when the button is clicked
                var adddetailpage = chartdetail.getAddDetailPage();
                console.debug("pushing detail " + adddetailpage)
                chartNavigation.push(adddetailpage);
            }
        }
        Button {
            text: "clear"
            
            onClicked:
                {
                                var count = chartNavigation.count() ;
                                console.log("nav count : " + count)
                                for (var i=0; i<count-1; i++)
                    {
                                        //                        chartNavigation.remove(chartNavigation.at(i));
                                        chartNavigation.pop();
                    }
                }
        }
    }
    
    attachedObjects: [
            ComponentDefinition {
                id: addDetailDefinition
                source: "ChartDetail.qml"
            }
        ]
        property Page addDetailPage
        function getAddDetailPage() {
            if (! addDetailPage) {
                addDetailPage = addDetailDefinition.createObject();
            }
            return addDetailPage;
        }
}
